﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using CefSharp;
using CefSharp.Wpf;
namespace Hammer_store
{
    /// <summary>
    /// Логика взаимодействия для MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        /* Событие-нажатие: Крестик для выхода из приложения */
        private void Image_cross_MouseDown(object sender, MouseButtonEventArgs e)
        {
            Application exit = Application.Current;
            exit.Shutdown();
        }

        /* Событие-нажатие: Распахнуть приложение на весь экран и вернуть обратно */
        private void Image_maximize_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (this.WindowState == WindowState.Normal)
                this.WindowState = WindowState.Maximized;
            else if (this.WindowState == WindowState.Maximized)
                this.WindowState = WindowState.Normal;
        }

        /* Событие-нажатие: Свернуть приложение */
        private void Image_colapso_MouseDown(object sender, MouseButtonEventArgs e)
        {
            this.WindowState = WindowState.Minimized;
        }

        /* Событие-нажатие левой кнопкой мыши: Перетаскивание окна */
        private void TitleBar_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ChangedButton == MouseButton.Left)
                this.DragMove();

            if (e.ChangedButton == MouseButton.Right & this.WindowState == WindowState.Normal)
                this.WindowState = WindowState.Maximized;
            else if
               (e.ChangedButton == MouseButton.Right & this.WindowState == WindowState.Maximized)
                this.WindowState = WindowState.Normal;
                 
        }

       
    }
}
